﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkillifyMaster.master" AutoEventWireup="true" CodeFile="ManageSubjects.aspx.cs" Inherits="ManageSubjects" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 38px;
        }
        .style3
        {
            height: 36px;
        }
        .style5
        {
            height: 39px;
            width: 56px;
        }
        .style7
        {
            height: 37px;
        }
        .style8
        {
            width: 56px;
        }
        .style9
        {
            height: 38px;
            width: 56px;
        }
        .style10
        {
            height: 35px;
            width: 56px;
        }
        .style11
        {
            height: 35px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style1">
        <tr>
            <td colspan="3" align="right">
                <h2> <asp:Label ID="lablManageSub" runat="server" Text="Manage Subject"></asp:Label></h2>
            </td>
        </tr>
        <tr>
            <td>
                <table align="center" cellspacing="2" style="border: 4px outset orange;" width="100%">
                    <tr>
                        <td class="style8">
                        </td>

                        <td>
                            <b><asp:Label ID="lablSubInfo" runat="server" Text="Add/Edit Subject Information"></asp:Label></b>
                        </td>

                        <td>
                        </td>
                    </tr>

                    <tr>
                        <td class="style9" valign="top">
                            <asp:Label ID="lablSubName" runat="server" Text="Subject"></asp:Label>
                        </td>
                        <td valign="top" class="style2">
                            <asp:TextBox ID="txtSubName" runat="server" Width="193px" AutoPostBack="True" 
                                ontextchanged="txtSubName_TextChanged"></asp:TextBox>
                        </td>
                        <td class="style2">
                            <asp:RequiredFieldValidator ID="reqFieldSubName" runat="server" 
                                ControlToValidate="txtSubName" ErrorMessage="Subject name cannot be null" 
                                ForeColor="Red">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>

                    <tr>
                    <td class="style8">
                        <asp:Label ID="lablTopic" runat="server" Text="Topic"></asp:Label>
                    </td>
                    <td valign="top">
                        <asp:ListBox ID="lblTopic" runat="server" Width="200px" AutoPostBack="True" 
                            onselectedindexchanged="lblTopic_SelectedIndexChanged"></asp:ListBox>
                    </td>
                </tr>

                    <tr>
                    <td class="style9">
                        </td>
                    <td class="style2">
                        <asp:TextBox ID="txtAddEditTopic" runat="server"></asp:TextBox>
        &nbsp;<asp:Button ID="btnAddEdit" runat="server" Text="Add" Width="56px" 
                            CausesValidation="False" onclick="btnAddEdit_Click" BackColor="#E49642" 
                            BorderColor="#CC7424" ForeColor="White" />
                    </td>
                    <td class="style2">
                        </td>
                    <td class="style2">
                        </td>
                </tr>

                <tr>
            <td class="style10">
                    </td>
            <td class="style11">
                <asp:CheckBox ID="chkIsActive" runat="server" Text="IsActive" />
            </td>
            <td class="style11">
                    </td>
            <td class="style11">
                    </td>
        </tr>

                    <tr>
            <td class="style9">
                        </td>
            <td class="style2">
                <asp:Button ID="btnClear" runat="server" Text="Clear" Width="60px" 
                    CausesValidation="False" onclick="btnClear_Click" BackColor="#E49642" 
                    BorderColor="#CC7424" ForeColor="White" />
&nbsp;<asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="60px" 
                    onclick="btnSubmit_Click" BackColor="#E49642" BorderColor="#CC7424" 
                    ForeColor="White" />
            </td>
            <td class="style2">
                        </td>
            <td class="style2">
                        </td>
        </tr>

                    

                    <tr>
            <td class="style5">
                &nbsp;</td>
            <td class="style3">
                <asp:ValidationSummary ID="validationMessage" runat="server" ForeColor="Red" />
            </td>
            <td class="style7">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>

                    <tr>
            <td class="style5">
                &nbsp;</td>
            <td class="style3">
               <b><asp:Label ID="lablError" runat="server" ForeColor="Red"></asp:Label></b>
            </td>
            <td class="style7">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
                </table>
            </td>

            <td>
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
            </td>

            <td>
                <table width="100%">
                    <tr>
                        <td align="center" valign="top">
                             <b><asp:Label ID="lablAvailSub" runat="server" Text="Available Subjects"></asp:Label></b>
                        </td>
                    </tr>

                    <tr>
                        <td align="right" valign="top" width="100%">
                            <asp:GridView ID="gvSubject" runat="server" AutoGenerateColumns="False" Width="550px"
                    onselectedindexchanged="gvSubject_SelectedIndexChanged" 
                    DataKeyNames="SubjectId"
                    BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
            CellPadding="2" ForeColor="Black" GridLines="None" AllowPaging="True" 
                                onpageindexchanging="gvSubject_PageIndexChanging" PageSize="15">
            <AlternatingRowStyle BackColor="PaleGoldenrod" />
                     <Columns>
                            <asp:ButtonField ButtonType="Link" DataTextField="SubjectId" HeaderText="SubjectId" SortExpression="SubjectId" CommandName="Select" ItemStyle-Font-Underline="true" />
                            <asp:BoundField DataField="SubjectName" HeaderText="SubjectName" SortExpression="SubjectName" />
                            <asp:BoundField DataField="IsAct" HeaderText="IsActive" SortExpression="IsActive" />
                      </Columns>
                     <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
         <FooterStyle BackColor="Tan" />
            <HeaderStyle BackColor="#CB6811" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                HorizontalAlign="Center" />
            <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedRowStyle BackColor="#E49642" ForeColor="GhostWhite" />
            <SortedAscendingCellStyle BackColor="#FAFAE7" />
            <SortedAscendingHeaderStyle BackColor="#DAC09E" />
            <SortedDescendingCellStyle BackColor="#E1DB9C" />
            <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                </asp:GridView>    
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>

